home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 February / EnigmA AMIGA RUN 15 (1997)(G.R. Edizioni)(IT)[!][issue 1997-02][PLANET CD V].iso / enigma / earcd / editor / editor2 / hsc.lha / hsc / src_docs / options.hsc < prev    next >
Text File  |  1996-12-04  |  12KB  |  283 lines

  1. <WEBPAGE chapter="hsc - " title="Invoking hsc"
  2.     PREV="install.html"
  3.     NEXT="examples.html"
  4.     QTEXT=("shoulder, bicep, elbow, arm<BR>"
  5.           +"forearm, thumb, wrist, knuckle, palm<BR>"
  6.           +"middle, pinky, index, ring<BR>"
  7.           +"dinner bell dinner bell ding")
  8.     QAUTHOR='They Might Be Giants, "Dinner Bell"'>
  9.  
  10. <*
  11. ** macro to format an explanation
  12. *>
  13. <$MACRO explan TITLE:string/r NAME:string ONLYDEFTAG:bool>
  14. <** create named reference **>
  15. <$IF COND=(SET NAME)>
  16. <A NAME=(Name)><$ELSE>
  17. <A NAME=(Title)></$IF>
  18. <DT><** create heading **>
  19. <KBD><(title)></KBD></A>
  20. <$IF COND=(ONLYDEFTAG)>
  21. (for use within <ln_deftag> only)
  22. </$IF>
  23. <DD>
  24. </$MACRO>
  25.  
  26. <*
  27. ** macro to format example for IGNORE
  28. *>
  29. <$MACRO exmp_ign VALUE:string/r>
  30. <DT><KBD><(value)></KBD>
  31. <DD>
  32. </$MACRO>
  33.  
  34. This section covers which
  35. <A HREF="#options">options</A> and
  36. <A HREF="#switches">switches</A> you can pass to <hsc>, 
  37. and which <A HREF="#exitcodes">exit codes</A> are returned to CLI.
  38.  
  39. <A NAME="general.rules"><H2>General rules for options</H2></A>
  40.  
  41. <P>As <hsc> is an tool developed under AmigaOS and I never liked
  42. the cryptic "<KBD>cmd -cvf -osepp.x</KBD>"-way of invoking commands comming
  43. from Unix, <hsc> uses a syntax like most commands of AmigaOS;
  44. even for ports on other operating-systems. (<TechNote> AmigaOS provides
  45. an OS-function called <CODE>ReadArgs()</CODE> for 
  46. argument-parsing.)</P>
  47.  
  48. <P>All options and swiches are case-insensitive. If you start <hsc>
  49. without any options, a short help message will be displayed.</P>
  50.  
  51. <P>Options can be followed by modifiers, which specify things such as
  52. the type of the option.  Modifiers are specified by following the
  53. option with a '/' and a single character modifier.  Multiple modifiers
  54. can be specified by using multiple '/'s.  Valid modifiers are:</P>
  55.  
  56. <DL>
  57. <DT><KBD>/S</KBD> - Switch.  
  58. <DD>This is considered a boolean variable, and will be
  59.    set if the option name appears in the command-line.  
  60. <DT><KBD>/K</KBD> - Keyword.  
  61. <DD>This means that the option will not be filled unless
  62.     the keyword appears.  For example if the template is 
  63.     <qq><KBD>Name/K</KBD></qq>,
  64.     then unless <qq><KBD>Name={string}</KBD></qq> 
  65.     or <qq><KBD>Name {string}</KBD></qq> appears in the
  66.     command line, Name will not be filled.
  67.  
  68. <DT><KBD>/N</KBD> - Number.  
  69. <DD>This parameter is considered a decimal number.
  70.     If an invalid number is specified, an error will be returned.  
  71. <*
  72.         /T - Toggle.  This is similar to a switch, but when specified causes
  73.              the boolean value to "toggle".  Similar to /S.*>
  74. <DT><KBD>/A</KBD> - Required.
  75. <DD>This keyword must be given a value during command-line
  76.     processing, or an error is returned.
  77. <*
  78.         /F - Rest of line.  If this is specified, the entire rest of the line
  79.              is taken as the parameter for the option, even if other option
  80.              keywords appear in it.*>
  81. <DT><KBD>/M</KBD> - Multiple strings.
  82. <DD>This means the argument will take any number strings.
  83.     Any arguments not considered to be part of another option will be 
  84.     added to this option.  
  85. </DL>
  86.  
  87. <A NAME="options"><H2>Options</H2></A>
  88.  
  89. <DL>
  90. <EXPLAN TITLE="FROM/M" NAME="from">
  91.     Specifies the input filename. To use <stdin> as
  92.     input file, the pseudo filename <CODE>STDIN</CODE> (case sensitive)
  93.     should be specified. If you specify more than one file,
  94.     the last file is taken as main source, and all previous files are
  95.     included before it. This is useful to include macro-definitions
  96.     within the command-line instead of an <ln_include> in the hsc-source.
  97. <EXPLAN TITLE="TO/K" NAME="to">
  98.     Specifies the output filename or the destination directory.
  99.     If the argument ends with a "<KBD>/</KBD>" (or also "<KBD>:</KBD>"),
  100.     it is interpreted as a directory. In this case, the name of the
  101.     outputfile is created from the name of the input file, with an
  102.     extension specified (see below). If no output file is set, <stdout> 
  103.     is used instead.<BR>
  104.     For details, read the seaction about
  105.     <A HREF="fileargs.html">File Options</A>
  106.     
  107. <EXPLAN TITLE="EXTENSION/K" NAME="extension">
  108.     If you specify a directory for output, the output-filename
  109.     will depend on the input-filename and the extension specified
  110.     with this options. If you do not set an extension, "<CODE>html</CODE>"
  111.     will be used. A <period> will be added automatically.
  112.     Setting <KBD>EXTENSION=.</KBD> will ommit this and result into exactly 
  113.     the same filename as the input.
  114.     If you specify a complete filename for output, this option has no
  115.     effect.
  116. <EXPLAN TITLE="MSGFILE/K" NAME="msgfile">
  117.     Redirects messages to a file. By default, <stderr> ist used.
  118. <EXPLAN TITLE="MSGFORMAT/K" NAME="msgformat">
  119.     Describes how messages should be displayed. Legal placeholders are:
  120.     <PRE>
  121.         %f      filename
  122.         %x, %y  location in file (column, line)
  123.         %c      message class
  124.         %i      message id (numeric)
  125.         %m      message text
  126.         %n      inserts a linefeed
  127.     </PRE>
  128.     Example: To get GCC-like messages, use
  129.     <CODE>MSGFORMAT="%f:%y: %c %i: %m"</CODE>.
  130. <EXPLAN TITLE="PREFSFILE/K" NAME="prefsfile">
  131.     Specifies filename for <A HREF=":features/prefs.html">sytax-definition</A>
  132.     to be used, if you don't want to use the defaults.
  133.  
  134. <EXPLAN TITLE="PRJFILE/K" NAME="prjfile">
  135.     Stores some information about the document currently processing
  136.     in a seperate file to extend functionality. Read the section
  137.     about <A HREF="project/index.html">Project managment</A> for more
  138.     details. Note that all documents within a project should use the
  139.     same project-file.
  140.  
  141. <EXPLAN TITLE="DEFINE=DEF/K/M" NAME="define">
  142.     Defines a global attribute. The syntax is equal to <ln_define>, exept
  143.     that you need no quotes surrounding the value.<BR>
  144.     Example: <CODE>DEFINE "hugo:string=hugo was here"</CODE>
  145.  
  146. <EXPLAN TITLE="IGNORE=IGN/K/M" NAME="ignore">
  147.     Ignore warning message number. Usually, <KBD>IGNORE</KBD> needs a numeric
  148.     argument and can occure multiple. Example:
  149. <PRE>
  150.         IGNORE=21 IGN=18 IGN 3         (ignore warnings #21, #18, #3)
  151. </PRE>
  152.     Additionally, you can give <KBD>IGNORE</KBD> some special values:
  153.     <DL>
  154.     <EXMP_IGN VALUE="ALL">
  155.         Ignore all non-error messages
  156.     <EXMP_IGN VALUE="NOTES">
  157.         Ignore all notes
  158.     <EXMP_IGN VALUE="BADSTYLE">
  159.         Ignore all bad style warnings
  160.     </DL>
  161.     All these special values add new messages to the list of messages
  162.     to be ignored, but do not reset any <KBD>IGNORE</KBD>s passed before.
  163. <EXPLAN TITLE="MODE/K" NAME="mode">
  164.     Set base mode for syntax check. Legal values are <KBD>PEDANTIC,
  165.     NORMAL</KBD> and <KBD>RELAXED</KBD>. Default is <KBD>NORMAL</KBD>.
  166.     This only disables several messages and warnings from the beginning.
  167.     Any <KBD>IGNORE</KBD>s passed before are reseted.
  168.  
  169. <EXPLAN TITLE="QUOTESTYLE/K" NAME="quotestyle">
  170.     Specifies which kind of quotes should be used to surround 
  171.     attribute-values. <KBD>KEEP</KBD> keeps the user-kind, 
  172.     <KBD>DOUBLE</KBD> tries to assign double quotes 
  173.     (eg. <CODE>"value"</CODE>), 
  174.     <KBD>SINGLE</KBD> tries to assign single quotes 
  175.     (eg. <CODE>'value'</CODE>) and <KBD>NONE</KBD> will remove
  176.     quotes if possible.
  177.  
  178. <EXPLAN TITLE="INCLUDEDIR=IDIR/K/M" NAME="includedir">
  179.     By default, only the current directory is scanned for files
  180.     to be included (using the CLI option <op_from> or the
  181.     special tags <ln_include> or <ln_exec>). This option adds a
  182.     directory to the list of directories to search for include
  183.     files.
  184.  
  185. <EXPLAN TITLE="STATUS/K" NAME="status">
  186.     Display several status messages (output goes to stderr). Legal
  187.     flags are:
  188.     <UL COMPACT>
  189.     <LI><KBD>QUIET</KBD>: no status messages
  190.     <LI><KBD>LINE</KBD>: display name and line of file currently processing
  191.         Included files are also displayed. After processing a file,
  192.         the filename and the total number of lines remain visible.
  193.     <LI><KBD>VERSION</KBD>: display program title and version
  194.     <LI><KBD>VERBOSE</KBD>: enable verbose status messages; this includes
  195.         the information displayed during the  processing of <ln_exec>
  196.         and some details about images, if <op_getsize> has also been
  197.         enabled.
  198.     <LI><KBD>FULL</KBD>: enable all status messages
  199.     </UL>
  200.     The above flags can be combined by separating them with a <vbar>,
  201.     eg <KBD>STATUS=line|version</KBD>, exept for <KBD>QUIET</KBD>
  202.     and <KBD>FULL</KBD>
  203. <EXPLAN TITLE="STRIPTAGS/K" NAME="striptags">
  204.     Strip some specific tags from document. You can specify a list of tags
  205.     which is a string,
  206.     that contains all tags that should be stripped, sepparated by a
  207.     <vbar>.<BR>
  208.     See also <op_stripcomment> and <op_stripexternal>.
  209. <EXPLAN TITLE="ICONBASE/K" NAME="iconbase">
  210.     Replace all icon entities by images that must be available from
  211.     the base URI specified. If this URI contains an <asterisk>, it 
  212.     will be substituted by the icon name. For
  213.     example, with <KBD>ICONBASE=:icons/*.gif</KBD>, the entity
  214.     <CODE>&back;</CODE>
  215.     is replaced by <TG>IMG SRC=":icons/back.gif" ALT="back"</TG>. Note
  216.     that this argument does not denote a directory, but an URI. It's
  217.     recommended to use an <fe_absuri>. 
  218. </DL>
  219.  
  220. <A NAME="switches"><H2>Switches</H2></A>
  221. <DL>
  222. <EXPLAN TITLE="HELP/S" NAME="help">
  223.     Display a short help message and exit.
  224. <EXPLAN TITLE="LICENSE/S" NAME="license">
  225.     Display a short version of the <A HREF="../COPYING">GNU General
  226.     Public License</A> and exit.
  227. <EXPLAN TITLE="COMPACT/S" NAME="compact">
  228.     <A HREF="features/strip.html">Strip redundant linefeeds
  229.     and white-spaces</A> from output.
  230. <EXPLAN TITLE="-DEBUG/S" NAME="-debug">
  231.     If you've compiled <hsc> in debug-mode, it will send lots of
  232.     information to <stderr>. Otherwise, this option is
  233.     equivalent to <KBD>STATUS=FULL</KBD>.
  234. <EXPLAN TITLE="GETSIZE/S" NAME="getsize">
  235.     <A HREF="features/getsize.html">Get width and height of images</A>
  236.      and set corresponding attributes
  237.     <CODE>WIDTH</CODE> and <CODE>HEIGHT</CODE> with these values;
  238. <EXPLAN TITLE="MSGANSI/S" NAME="msgansi">
  239.     Uses ANSI-sequences to make messages more readable. This option is
  240.     recommended to be used by people who are not smart enough to integrate
  241.     <hsc> in some of the existing project-managment environments.
  242. <EXPLAN TITLE="RPLCENT/S" NAME="rplcent">
  243.     <A HREF="features/rplcent.html">Replace special characters</A> with
  244.     their entities (eg <qq><CODE>ü</CODE></qq> becomes 
  245.     <qq><CODE>&uuml</CODE></qq>).
  246. <EXPLAN TITLE="RPLCQUOTE/S" NAME="rplcquote">
  247.     Replace double-quotes (<qq><CODE>"</CODE></qq>) found in the text by 
  248.     <qq><CODE>&quot;</CODE></qq>. This does not affect quotes used inside
  249.     attribute-values.
  250. <EXPLAN TITLE="SMARTENT/S" NAME="smartent">
  251.     Replace special characters <qq><CODE>&</CODE></qq>, 
  252.     <qq><CODE><</CODE></qq>
  253.     and <qq><CODE>></CODE></qq> with their entities
  254.     (<CODE>&amp;, &lt;</CODE> and <CODE>&gt;</CODE>) if they are
  255.     surrounded by white-spaces. 
  256. <EXPLAN TITLE="STRIPBASWS/S" NAME="stripbadws">
  257.     Strip bad white spaces that would have caused message #78 or #79;
  258.     this will not strip those wich cause message #3. The main advantage
  259.     of this switch is that it allows you to write well structured
  260.     macros.
  261. <EXPLAN TITLE="STRIPCOMMENT/S" NAME="stripcomment">
  262.     Strip all SGML-comments from input.
  263. <EXPLAN TITLE="STRIPEXTERNAL/S" NAME="stripexternal">
  264.     Strip tags which refer to an external URI.
  265. </DL>
  266.  
  267. <A NAME="exitcodes"><H2>Exit Code</H2></A>
  268.  
  269. <P>The exit-code <hsc> returns to the CLI depends on the messages and errors
  270. that have been displayed during runtime.</P>
  271.  
  272. <P>The version for AmigaOS returns 
  273. <UL>
  274. <LI><CODE>0</CODE> on success,
  275. <LI><CODE>5</CODE> if warnings occured,
  276. <LI><CODE>10</CODE> if errors showed up (also for errors in args) and 
  277. <LI><CODE>20</CODE> if fatal errors happned (also for out-of-resources).
  278. </UL>
  279.  
  280. For other systems, values like <CODE>0/0/1/2</CODE> are used instead.
  281.  
  282. </WEBPAGE>
  283.